]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
searchController: Query stage for target actor instead of event.get_source()
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 25 Feb 2022 12:10:30 +0000 (13:10 +0100)
committerMarge Bot <marge-bot@gnome.org>
Fri, 4 Mar 2022 12:27:34 +0000 (12:27 +0000)
Events are going to stop containing the destinatary, so stop using this
API. Querying the stage is equivalent and ensured to be up-to-date.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2216>

js/ui/searchController.js

index 5d25897c7957745377ae857e3ac8cbad7b5813c1..ac22439a44b01ae49f225bf88ac69815496fbfb8 100644 (file)
@@ -306,12 +306,12 @@ var SearchController = GObject.registerClass({
 
     _onCapturedEvent(actor, event) {
         if (event.type() === Clutter.EventType.BUTTON_PRESS) {
-            let source = event.get_source();
-            if (source !== this._text &&
+            const targetActor = global.stage.get_event_actor(event);
+            if (targetActor !== this._text &&
                 this._text.has_key_focus() &&
                 this._text.text === '' &&
                 !this._text.has_preedit() &&
-                !Main.layoutManager.keyboardBox.contains(source)) {
+                !Main.layoutManager.keyboardBox.contains(targetActor)) {
                 // the user clicked outside after activating the entry, but
                 // with no search term entered and no keyboard button pressed
                 // - cancel the search